package com.easy.query.test.h2.vo.proxy;

import com.easy.query.core.expression.parser.core.available.TableAvailable;
import com.easy.query.core.proxy.AbstractProxyEntity;
import com.easy.query.core.proxy.SQLColumn;
import com.easy.query.core.proxy.SQLSelectAsExpression;
import com.easy.query.core.proxy.fetcher.AbstractFetcher;
import com.easy.query.core.proxy.core.EntitySQLContext;
import com.easy.query.test.h2.vo.QueryVO;
import com.easy.query.core.proxy.columns.types.SQLStringTypeColumn;

/**
 * this file automatically generated by easy-query, don't modify it
 * 当前文件是easy-query自动生成的请不要随意修改
 * 如果出现属性冲突请使用@ProxyProperty进行重命名
 *
 * @author easy-query
 */
public class QueryVOProxy extends AbstractProxyEntity<QueryVOProxy, QueryVO> {

    private static final Class<QueryVO> entityClass = QueryVO.class;

    public static final QueryVOProxy TABLE = createTable().createEmpty();

    public static QueryVOProxy createTable() {
        return new QueryVOProxy();
    }

    public QueryVOProxy() {
    }

    /**
     * {@link QueryVO#getId}
     */
    public SQLStringTypeColumn<QueryVOProxy> id() {
        return getStringTypeColumn("id");
    }

    /**
     * {@link QueryVO#getField1}
     */
    public SQLStringTypeColumn<QueryVOProxy> field1() {
        return getStringTypeColumn("field1");
    }

    /**
     * {@link QueryVO#getField2}
     */
    public SQLStringTypeColumn<QueryVOProxy> field2() {
        return getStringTypeColumn("field2");
    }


    @Override
    public Class<QueryVO> getEntityClass() {
        return entityClass;
    }

    @Override
    public QueryVOProxy createNew() {
        return createTable();
    }


    /**
     * 数据库列的简单获取
     *
     * @return
     */
    public QueryVOProxyFetcher FETCHER = new QueryVOProxyFetcher(this, null, SQLSelectAsExpression.empty);


    public static class QueryVOProxyFetcher extends AbstractFetcher<QueryVOProxy, QueryVO, QueryVOProxyFetcher> {

        public QueryVOProxyFetcher(QueryVOProxy proxy, QueryVOProxyFetcher prev, SQLSelectAsExpression sqlSelectAsExpression) {
            super(proxy, prev, sqlSelectAsExpression);
        }


        /**
         * {@link QueryVO#getId}
         */
        public QueryVOProxyFetcher id() {
            return add(getProxy().id());
        }

        /**
         * {@link QueryVO#getField1}
         */
        public QueryVOProxyFetcher field1() {
            return add(getProxy().field1());
        }

        /**
         * {@link QueryVO#getField2}
         */
        public QueryVOProxyFetcher field2() {
            return add(getProxy().field2());
        }


        @Override
        protected QueryVOProxyFetcher createFetcher(QueryVOProxy cp, AbstractFetcher<QueryVOProxy, QueryVO, QueryVOProxyFetcher> prev, SQLSelectAsExpression sqlSelectExpression) {
            return new QueryVOProxyFetcher(cp, this, sqlSelectExpression);
        }
    }


    public static final class Fields {
        public static final String id = "id";
        public static final String field1 = "field1";
        public static final String field2 = "field2";

        private Fields() {
        }
    }
}
